package com.blank.task19;

import java.io.Serializable;

public class UserMessage implements Serializable {
    private static final long serialVersionUID = -6780246680993633002L;
    //1、私有化成员变量
    private String type;  //类型
    private User user;  //用户

    //2、构造方法
    //无参构造
    public UserMessage() {
    }
    //有参构造

    public UserMessage(String type, User user) {
        setType(type);
        setUser(user);
    }
    //getter和setter

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }
    //打印输出

    @Override
    public String toString() {
        return "UserMessage{" +
                "type='" + type + '\'' +
                ", user=" + user +
                '}';
    }
}
